import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
/** 检查登陆状态 */
export const checkLogin = data => {
  return http.request("post", baseUrlApi("/login/checkLogin"), { data });
};
/** 获取qrCode*/
export const getQrCode = () => {
  return http.request("get", baseUrlApi("/login/getWxQrCode"));
};
/**获取用户信息*/
export const getUserInfo = () => {
  return http.request("get", baseUrlApi("/user/getUserInfo"));
};

//更新用户信息
export const updateUserInfo = data => {
  return http.request("post", baseUrlApi("/user/updateUserInfo"), { data });
};
//头像上传
export const uploadAvatar = data => {
  return http.request(
    "post",
    baseUrlApi("/image/upload"),
    { data },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
};
//消息通知
export const getNotice = () => {
  return http.request("get", baseUrlApi("/message/getMyNotice"));
};
//消息通知
export const updateToReadedStatus = data => {
  return http.request("post", baseUrlApi("/message/updateToReadedStatus"), {
    data
  });
};
